#ifndef TD_BASEPANEL_H_
#define TD_BASEPANEL_H_


/************************************************************************/
/* STL                                                                  */
/************************************************************************/
#include <string>
#include <sstream>

/************************************************************************/
/* PROJECT                                                              */
/************************************************************************/

/************************************************************************/
/* Core                                                                 */
/************************************************************************/
#include "Core/BaseEntity.h"

/************************************************************************/
/* GUI                                                                  */
/************************************************************************/
#include "GUI/TextMessages/TextMessage.h"

/************************************************************************/
/* Game                                                                 */
/************************************************************************/
#include "Game/Game Objects/Towers/BaseTower.h"
#include "Game/Animations/AnimationSet.h"

/************************************************************************/
/* Resources                                                            */
/************************************************************************/
#include "Resources/Tiles/Tile.h"
#include "Resources/ResourceManager.h"

using namespace std;
using namespace boost;
using namespace TD_Core;
using namespace TD_Game;

namespace TD_GUI {

	typedef enum {
		towerSelected,
		towerInserting,
		towerInserted,
		towerInsertingInvalid,
		towerHideInserting,
		towerUpgrade,
		towerSell,
		towerShowStaticInfo,
		towerHideStaticInfo,
		towerShowInfo,
		towerHideInfo,
		creepShowInfo,
		creepHideInfo,
		startNextWave,
		advanceToGame,
		gameExit,
		showMenu,
		hideMenu,
		restartGame,	
		towerInfoEvent,
		noInteraction
	} interactionType;

	typedef struct {
		int type;
		int value;
		Coord2D position;
		towerTypes towerType;
	} interaction_t;


	class BasePanel : public Tile {


	protected:
		/************************************************************************/
		/* Static definitions                                                   */
		/************************************************************************/
		static const string m_defaultFont;
		static const unsigned int m_defaultFontSize;
		static const Color m_defaultFontColor;
		
		bool m_isVisible;

		inline string intToStr(int number) {
			stringstream os;
			os << number;
			return(os.str());
		}
		
	public:
		/************************************************************************/
		/* ctors and dtors					                                    */
		/************************************************************************/
		//Default constructor
		explicit BasePanel();

		//Copy constructor
		explicit BasePanel(const BasePanel &rhs);

		//Assignment constructor
		BasePanel& operator=(const BasePanel &rhs);

		//Initialization
		explicit BasePanel(const Coord2D &initialPosition, const Coord2D &bounds);

		//Destructor
		~BasePanel();
		
		/************************************************************************/
		/* Access                                                               */
		/************************************************************************/
		
		inline bool isVisible() const {
			return(m_isVisible);
		}

		inline void setVisible(bool visible) {
			m_isVisible = visible;
		}

		/************************************************************************/
		/* Rendering                                                            */
		/************************************************************************/
		virtual void render(SDL_Surface *const g_destSurface, unsigned int deltaTime);

		virtual interaction_t processEvent(const SDL_Event &event) = 0;
	};
}
#endif